package com.hw.disruptor.workHandler;

import com.hw.disruptor.event.LongEvent;
import com.lmax.disruptor.WorkHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * @program: disruptor-quickstart
 * @author: hewei
 * @date: 2023-07-06 15:42
 * <p>
 * 通过实现接口 com.lmax.disruptor.EventHandler 定义事件处理的具体实现。
 * </p>
 **/
@Slf4j
public class LongWorkHandler implements WorkHandler<LongEvent> {
    @Override
    public void onEvent(LongEvent event) throws Exception {
        System.out.println("worker:" + Thread.currentThread().getName() + " Event: value=" + event.getValue());
    }
}
